<template>
  <div class="wrapper" ref="wrapper">
    <ul class="content" v-if="discList.length">
      <li v-for="(v, index) in discList" :key="index">{{v.commit_time}}</li>
    </ul>
  </div>
</template>

<script>
import BScroll from 'better-scroll'
import Scroll from 'base/scroll/scroll'
import { getDiscList } from 'api/recommend'
export default {
  components: {Scroll},
  data() {
    return {
      discList: []
    }
  },
  mounted() {
    if (!this.$refs) {
      return
    }
    this._getDiscList()
  },
  methods: {
    _getDiscList() {
      getDiscList().then(res => {
        this.discList = res.data.list
        this.$nextTick(() => {
          this.scroll = new BScroll(this.$refs.wrapper, {})
        })
      })
    }
  }
}
</script>

<style scoped lang="stylus">
  .wrapper
    position fixed
    top 10px
    width 100vw
    height 100px
    .content
      height 100%
      background-color orangered
</style>
